<% layout('/layout/default.html', {title: '流程表单信息', libs: ['layui']}){ %>
<div class="main-content">
	<div class="card-header">
		<i class="fa fa-sitemap"></i> 流程表单信息
		<div class="header-tools float-right">
			<a href="#" class="btn btn-default btn-sm" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
			<% if(hasPermi('flowable:flowForm:edit')){ %>
			<a href="/act/flowForm/form" class="btn btn-default btn-sm btnTool"  title="新增流程表单信息"><i class="fa fa-plus"></i> 新增</a>
			<% } %>
		</div>
	</div>
	<div class="container-fluid">
		<form id="searchForm" action="${ctx}/act/flowForm/listData" class="form-inline d-none">
			<div class="form-group">
				<button type="submit" class="btn btn-success btn-sm ">查询</button>
				<button id="reset" type="reset" class="btn btn-default btn-sm">重置</button>
			</div>
		</form>
		<table id="btGrid"></table>
	</div>
</div>
<% } %>
<script>
//初始化DataTables对象
$('#btGrid').BTGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{title:'模型名称', field:'modelName'},
		{title:'模型key', field:'modelKey'},
		{title:'流程模型版本', field:'modelVersion'},
		{title:'更新时间', field:'updateDate', templet: function (row) {
			if (row.updateDate){   // data不为空进行转换
				return (new Date(row.updateDate)).Format("yyyy-MM-dd hh:mm:ss");
			} else {
				return ''; //data为空时不转换
			}
		}},
		{title:'操作', templet: function(row){
			var actions = [];
			actions.push('<a href="${ctx}/act/flowForm/preview?id='+row.id+'" class="btn btn-xs btn-success btnList" title="表单预览" data-type="diagram"><i class="fa fa-desktop"></i></a>&nbsp;&nbsp;');
			<% if(hasPermi('flowable:flowForm:edit')){ %>
                actions.push('<a href="/act/flowForm/userPermission?id='+row.id+'" class="btn btn-xs btn-info btnList" title="人员权限关联"><i class="fas fa-link"></i></a>&nbsp;');
                actions.push('<a href="${ctx}/act/flowForm/copy?id='+row.id+'" class="btn btn-xs btn-info btnList" title="复制增加版本信息" data-confirm="确认要对该流程表单复制以及增加版本吗？"><i class="far fa-copy"></i></a>&nbsp;&nbsp;');
                actions.push('<a href="${ctx}/act/flowForm/delete?id='+row.id+'" class="btn btn-xs btn-danger btnList" title="删除流程表单信息" data-confirm="确认要删除该流程表单信息吗？"><i class="far fa-trash-alt"></i></a>&nbsp;&nbsp;');
            <% } %>
			
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});

</script>